package com.demo.search;

import java.io.Reader;

import org.apache.lucene.analysis.Analyzer;
import org.apache.lucene.analysis.LetterTokenizer;
import org.apache.lucene.analysis.TokenStream;
import org.apache.lucene.util.Version;
import org.wltea.analyzer.lucene.IKTokenizer;

/**
 * 近义词分析器
 * @author ryuu.kk
 *
 */
public class MetaphoneReplacementAnalyzer extends Analyzer {

	@Override
	public TokenStream tokenStream(String fieldName, Reader reader) {
		// return new MetaphoneReplacementFilter(new LetterTokenizer(Version.LUCENE_36, reader));
		return new MetaphoneReplacementFilter(new IKTokenizer(reader, false));
	}
}
